#!/bin/sh
. /etc/functions.sh
NAME=ez-ipupdate
CONFIG=/etc/$NAME.conf
COMMAND=/usr/sbin/$NAME
[ "$ACTION" = "ifup" -a "$INTERFACE" = "wan" ] && {
	[ "$(nvram get ddns_enable)" = "1" ] && [ -x $COMMAND ] && [ -r $CONFIG ] && {
		IFNAME=$(nvram get ${INTERFACE}_ifname)
		$COMMAND -c $CONFIG -i $IFNAME 2>&1 | logger -t $NAME
	} &
}
